<template>
  <div class="editor-com-container">
    loading
    <el-button @click="selectAll">selectAll</el-button>
    <div
        id="json-editor-body"
         contenteditable="true">

    </div>
  </div>
</template>

<script>
import {defineComponent, reactive, ref} from "vue";

export default defineComponent({
  components: {},
  props: {},
  setup(props, context) {

    return {
      jsonData: ref("")
    }
  },
  mounted() {
    let elementById = document.getElementById("json-editor-body");
    document.execCommand("2D-Position","false","true");
  },
  methods: {
    beauty() {
      console.log("eee")
    },
    selectAll() {
      document.execCommand("selectAll");
    }
  }
})
</script>

<style scoped>
#json-editor-body {
  width:400px;
  height:600px;
  overflow: auto;
  border:2px solid red;
  text-align: left;
  padding: 10px;
}
</style>
